<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head th:include="include :: header"></head>
    <body class="hold-transition skin-blue sidebar-mini">

        <section class="content-header">
            <h1>项目文件查询</h1>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <form id="queryForm">
                                <div class="row">
                                    <div class="form-inline">
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>名称</label>
                                            <input type="text" name="name" class="form-control" placeholder="请输入项目名称或订单号或代码">
                                        </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>下任务</label>
                                            <select name="sendFileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>工艺编制-铝模板</label>
                                            <select name="process1FileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>工艺编制-铝背楞</label>
                                            <select name="process2FileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>

                                        <button type="button" class="btn btn-success" id="btn-search">
                                            <!--<i class="fa fa-search"></i>-->
                                            <span class="Bold">搜索</span>
                                        </button>
                                    </div>
                                </div>
                                <div class="row" style="margin-top: 10px">
                                    <div class="form-inline">
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>平库</label>
                                            <select name="consumeFileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                       </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>喷涂</label>
                                            <select name="sprayFileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>包装</label>
                                            <select name="packFileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-right: 10px;">
                                            <label>仓储</label>
                                            <select name="storeFileNum" class="form-control" >
                                                <option value="" selected="selected">全部</option>
                                                <option value="1">已上传</option>
                                                <option value="2">未上传</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="box-body">
                            <table id="bootstrap-table"></table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <div th:include="include :: footer"></div>
        <script th:inline="javascript">

            $(function () {

                /**
                 * 加载列表
                 */
                table = js.table.init({
                    url: ctx + "integrate/files/list",
                    showColumns: true,
                    showExport: true,
                    columns: [
                        {
                            title: '序号', field: 'id', width: '40',
                            formatter: function (value, row, index, field) {
                                return index + 1;
                            }
                        },
                        {title: '项目名称', field: 'name', width: '200'},
                        // {title: '客户', field: 'client'},
                        {title: '订单号', field: 'orderNum', width: '60'},
                        {title: '代码', field: 'code', width: '80'},
                        {title: '数量', field: 'num'},
                        // {title: '非标件', field: 'non'},
                        {title: '面积', field: 'area'},
                        {title: '喷涂要求', field: 'spray'},
                        {title: '是否拼装', field: 'assemble',
                            formatter: function (value, row, index) {
                                if (value === 1) {
                                    return '拼装';
                                }else if (value === 0) {
                                    return '免拼装';
                                }
                            }
                        },
                        /*{title: '生产厂', field: 'factories',
                            formatter: function (value, row, index) {
                                if (value != null) {
                                    return value.split(',').join('<br>');
                                }
                            }
                        },*/
                        // {title: '备注', field: 'remark', width: '200'},
                        {title: '下任务', field: 'sendFileNum', width: '70'},
                        {title: '工艺编制<br>铝模板', field: 'process1FileNum', width: '70'},
                        {title: '工艺编制<br>铝背楞', field: 'process2FileNum', width: '70'},
                        {title: '平库', field: 'consumeFileNum', width: '70'},
                        {title: '喷涂', field: 'sprayFileNum', width: '70'},
                        {title: '包装', field: 'packFileNum', width: '70'},
                        {title: '仓储', field: 'storeFileNum', width: '70'},
                        {
                            title: '操作', width: '40',
                            formatter: function (value, row, index) {
                                var actions = [];
                                actions.push('<a class="btn btn-info btn-xs" target="_blank" href="'+ ctx + 'board/single/' + row.id + '"> 查看</a> ');

                                return actions.join('');
                            }
                        }
                    ]
                });

                /**
                 * 表格搜索
                 */
                $("#btn-search").click(function () {
                    js.table.search(table);
                });
            });
        </script>
    </body>
</html>
